package com.stylefeng.guns.core.base.tips;

import org.apache.commons.lang3.StringUtils;

/**
 * 返回给前台的成功提示
 *
 * @author fengshuonan
 * @date 2016年11月12日 下午5:05:22
 */
public class SuccessTip extends Tip {
	
	public SuccessTip(){
		super.code = 200;
		super.message = "操作成功";
	}


	public static SuccessTip fail(String msg){
		return new SuccessTip().setMessage(msg);
	}

	public SuccessTip setMessage(String msg) {
		super.code = 100;
		if(StringUtils.isNotBlank(msg)){
			super.message = msg;
		}else{
			super.message = "操作失败";
		}
		return this;
	}

}
